package com.jsu.bean;

import java.io.Serializable;

import net.bytebuddy.asm.Advice.This;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jsu.dao.FoundMessageMapper;
import com.jsu.bean.FoundId;

public class FoundId extends CurrentMax implements Serializable {
	static final long serialVersionUID = 1L;
	private static class Inner {
		private static FoundId foundId = new FoundId();
	}
	
	private FoundId(){
		if (Inner.foundId != null)
            try {
                throw new IllegalAccessException("单例对象已经被实例化，请不要非法反射构造函数");
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
	}
	
	public static FoundId getInstance(){
		return Inner.foundId;
	}
	
//	@Autowired
//	FoundMessageMapper foundMessageMapper;
//	
//	private static FoundId foundId = new FoundId();
////	private static class Inner {
////		private static FoundId foundId = new FoundId();
////		int id = foundMessageMapper.selectLastId();
////	}
////	
//	private FoundId(){
////		if (Inner.foundId != null)
////            try {
////                throw new IllegalAccessException("单例对象已经被实例化，请不要非法反射构造函数");
////            } catch (IllegalAccessException e) {
////                e.printStackTrace();
////            }
//		//int id = foundMessageMapper.selectLastId();
//		foundId.setCurrentId(2);
//		foundId.setMaxId(2);
//	}
//	
//	public static FoundId getInstance(){
//		return foundId;
//	}
}
